package vincent.com.layouttest;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.DisplayMetrics;
import android.view.ViewGroup;
import android.webkit.WebView;

/**
 * Created by chenzhengwen on 2015/5/29.
 */
public class WebViewActivity extends ActionBarActivity {
    private WebView mWebView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        mWebView = (WebView)findViewById(R.id.web_view);
        mWebView.setVerticalScrollBarEnabled(true);
        mWebView.setHorizontalScrollBarEnabled(true);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.loadUrl("http://m.baidu.com/?from=2001a");

//        mWebView.loadUrl("http://pica.nipic.com/2007-12-23/200712231523651_2.jpg");
    }

    @Override
    protected void onResume() {
        super.onResume();
        DisplayMetrics metric = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metric);
        int widthDp = (int)(metric.widthPixels/metric.density);
    }
}
